home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Libris Britannia 4
/
science library(b).zip
/
science library(b)
/
PROGRAMM
/
ASSEMBLE
/
H055.ZIP
/
DEMO
/
CLOCK.ALC
next >
Wrap
Text File
|
1987-07-20
|
3KB
|
122 lines
TITLE 'CLOCK.ALC - TRANSPARENT PC/370 OS TO DISPLAY CLOCK'
*********
*
* PGMID. CLOCK.ALC (LINKED TO CLOCK.MOD FOR DYNMAIC LOAD AND EXEC)
* AUTHOR. DON HIGGINS
* DATE. 04/26/87
* REMARKS.
* THIS MODULE DEFINES TRANSPARENT SVC HANDLER AND EXTERNAL
* INTERRUPT HANDLER TO ALLOW DISPLAYING TIME AND DATE IN
* UPPER LEFT CORNER OF SCREEN. RETURN FROM THIS MODULE IS
* VIA LPSW WHICH PLACES CALLING PROGRAM IN PROBLEM STATE WITH
* EXTERNAL INTERRUPTS ENABLED.
* MAINTENANCE.
*
* 07/20/87 USE PSA DSECT WITH REGISTER 0 FOR LOW MEMORY ACCESS
*
*
*
*
*********
CLOCK CSECT
USING *,R15
USING PSA,R0
L R0,=V(DTIME)
S R0,=A(CLOCK)
AR R0,R15 CALC DTIME ENTRY FOR COM OR MOD
ST R0,ADTIME SAVE DTIME RTN ENTRY
LA R0,SVCRTN
ST R0,SVCPSW+4 INIT NEW SVC PSW ADDR
LA R0,EXTRTN
ST R0,EXTPSW+4 INIT NEW EXT PSW ADDR
MVC NEWSVC(8),SVCPSW SET NEW SVC PSW
MVC NEWEXT(8),EXTPSW SET NEW EXT PSW
ST R14,PRBPSW+4 INIT PROBLEM STATE EXIT PSW ADDR
LPSW PRBPSW EXIT WITH NEW PROBLEM PSW
SVCPSW DS 0D
DC X'070C0000',A(*-*) ENTER SVC HANDLER IN SUPR STATE
EXTPSW DS 0D
DC X'070C0000',A(*-*) ENTER EXT HANDLER IN SUPR STATE
PRBPSW DS 0D
DC X'070D0000',A(*-*) RETRUN TO CALLER IN PROB. STATE
*********
*
* TRANSPARENT SVC INTERRUPT HANDLER
*
*********
SVCRTN EQU *
DROP R15
ST R15,NEWSVC+4 USE NEW SVC PSW AS TEMP STORGE FOR BASE
BALR R15,0 INIT BASE
USING *,R15
ST R14,SVCSAV
L R14,NEWSVC+4
ST R14,SVCSAV+4 SAVE R14-R15 FOR RESTORE
LR R14,R15
BCTR R14,0
BCTR R14,0
ST R14,NEWSVC+4 RESET NEW SVC PSW
L R14,OLDSVC+4 R14 = ADDR SVC + 2
BCTR R14,0
ICM R14,8,0(R14) GET SVC #
STCM R14,8,SVCXX+1 SETUP SVC TO ISSUE IN SUPR STATE
LM R14,R15,SVCSAV RESTORE ALL REGS
SVCXX SVC *-* REISSUE SVC
LPSW OLDSVC EXIT TO INSTR AFTER ORIG SVC IN PROB STATE
SVCSAV DC 2F'0' SAVE R14-R15
********
*
* EXTERNAL INTERRUPT RTN TO DISPLAY CLOCK IN UPPER LEFT OF SCREEN
*
********
EXTRTN EQU *
DROP R15
ST R15,NEWEXT+4 USE NEW EXT PSW AS TEMP SAVE
BALR R15,0
USING *,R15
ST R14,EXTSAV SAVE ORIG R14,R15,R0,R1
L R14,NEWEXT+4
ST R14,EXTSAV+4
STM R0,R1,EXTSAV+8
LR R14,R15
BCTR R14,0
BCTR R14,0
ST R14,NEWEXT+4 RESET NEWEXT PSW
L R15,ADTIME
DROP R15
BALR R14,R15 DISPLAY TIME
USING *,R14
LM R14,R0,EXTSAV RESTORE ALL REGS
LPSW OLDEXT EXIT TO NEXT INSTR IN PROB STATE
DROP R14
EXTSAV DC 4F'0' SAVE R14-R1
ADTIME DC A(8-8) ADDRESS OF DISPLAY TIME ROUTINE
********
*
* COMMON DATA
*
********
R0 EQU 0
R1 EQU 1
R14 EQU 14
R15 EQU 15
*********
*
* PSA - PREFIX STORAGE AREA DSECT (SEE PSW.DOC FOR MORE INFO.)
*
*********
PSA DSECT
ORG PSA+X'18'
OLDEXT DS D X'18' OLD EXTERNAL PSW
OLDSVC DS D X'20'OLD SUPERVISOR CALL PSW
OLDPGM DS D X'28' OLD PROGRAM CHECK PSW
OLDMCK DS D X'30' OLD MACHINE CHECK PSW
OLDIOS DS D X'38' OLD I/O INTERRUPT PSW
ORG PSA+X'58'
NEWEXT DS D X'58' NEW EXTERNAL PSW
NEWSVC DS D X'60' NEW SUPERVISOR CALL PSW
NEWPGM DS D X'68' NEW PROGRAM CHECK PSW
NEWMCK DS D X'70' NEW MACHINE CHECK PSW
NEWIOS DS D X'78' NEW I/O INTERRUPT PSW
END CLOCK